package com.tz.oa.sysmanage.controller;

import com.tz.oa.sysmanage.entity.User;
import com.tz.oa.sysmanage.entity.UserInformation;
import com.tz.oa.sysmanage.entity.Userinfo;
import com.tz.oa.sysmanage.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.*;

@Controller
@RequestMapping("/docUser")
public class DocUserController {
    @Autowired
    private IUserService iUserService;


    @RequestMapping("/gotoLogin")
    public String gotoLogin(){
        return "testform";
    }

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public String addUser(UserInformation userInformation){
        System.out.println("---" + userInformation.toString());
        Integer userid = iUserService.insert(userInformation);
        return "uploadsuccess";
    }

}
